﻿Public Class inscription
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Private Sub SubmitInscription_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubmitInscription.Click

        Dim clientCompose As New client

        clientCompose.nomClient = TxtBoxNom.Text.ToString()
        clientCompose.prenomClient = TxtBoxPrenom.Text.ToString()
        clientCompose.noCiviqueClient = TxtBoxNumRue.Text.ToString()
        clientCompose.rueClient = TxtBoxNomRue.Text.ToString()
        clientCompose.codePostalClient = TxtBoxCP.Text.ToString()
        clientCompose.villeClient = TxtBoxVille.Text.ToString()
        clientCompose.telephoneClient = TxtBoxTelephone.Text.ToString()
        clientCompose.courrielClient = TxtBoxCourriel.Text.ToString()
        clientCompose.passwordClient = TxtBoxMdp.Text.ToString()

        Dim dbEp As New dbEpicerieDataContext()


        Dim man As New dbManager(dbEp)

        man.CreationUtilisateur(clientCompose)

        Response.Redirect("/login.aspx")
    End Sub


    Private Sub Beffacer_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Beffacer.Click

        TxtBoxCourriel.Text = ""
        TxtBoxMdp.Text = ""
        TxtBoxMdpConf.Text = ""
        TxtBoxNom.Text = ""
        TxtBoxPrenom.Text = ""
        TxtBoxNumRue.Text = ""
        TxtBoxNomRue.Text = ""
        TxtBoxCompAdr.Text = ""
        TxtBoxVille.Text = ""
        TxtBoxCP.Text = ""
        TxtBoxTelephone.Text = ""
        CheckBoxConfCGU.Checked = False

    End Sub
End Class